package com.yds.dubbo.hystrix.provider;

import com.yds.dubbo.common.EmbeddedZooKeeper;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;

import java.util.concurrent.CountDownLatch;

/**
 * @author liuhongzhen
 * @date 2023/3/24 15:15
 */
@SpringBootApplication
@EnableHystrix
@EnableDubbo(scanBasePackages = {"org.apache.dubbo.spring.boot.provider.impl"})
public class ProviderBootstrap {

    public static void main(String[] args) throws Exception {

        new EmbeddedZooKeeper(2181, false).start();

        SpringApplication.run(ProviderBootstrap.class, args);

        System.out.println("dubbo service started");
        new CountDownLatch(1).await();
    }
}
